from django.db import models
from company.models import Company


class Dependent(Employee):
    relation = models.ForeignKey(Relation)
 
    def __unicode__(self):
        return self.relation

class Relation(models.Model):
    name = models.CharField(max_length=100)

    def __unicode__(self):
        return self.name


class Employee('Person.Person'):
    company = models.ForeignKey(Company)
    jobTitle = models.CharField(max_length=100,blank=True,null=True)

    sponsor =  models.ManyToManyField('Person.Person', blank=True, null=True)

    dependents = models.ManyToManyField(Dependent, blank=True, null=True)

    def __unicode__(self):
        return self.firstName + self.lastName


